package com.jf.cloud.delivery.feign;

import com.jf.cloud.api.delivery.feign.StationFeignClient;
import com.jf.cloud.api.delivery.vo.StationVO;
import com.jf.cloud.common.response.ServerResponseEntity;
import com.jf.cloud.delivery.service.StationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StationFeignController implements StationFeignClient {
    @Autowired
    private StationService stationService;

    @Override
    public ServerResponseEntity<StationVO> getStation(Long stationId) {
        return ServerResponseEntity.success(stationService.getByStationId(stationId));
    }

    @Override
    public ServerResponseEntity<StationVO> getStationByInside(Long stationId) {
        return ServerResponseEntity.success(stationService.getByStationId(stationId));
    }

    @Override
    public ServerResponseEntity<Double> getStationDistance(Long stationId, Double lat, Double lng) {
        return ServerResponseEntity.success(stationService.getStationDistance(stationId, lat, lng));
    }
}
